<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>reject方法</title>
</head>

<body>
    <!-- 
        Promise.reject方法将始终返回一个失败的Promise对象
        无论参数是否为Promise还是其他 最终都将返回失败的Promise
    -->
    <div id="cc"></div>
    <script>
        const p1 = Promise.reject(123)
        console.log(p1)

        const p2 = Promise.reject(new Promise((resolve, reject) => {
            resolve(345)
        }))
        console.log(p2)
        // document.getElementById('cc').innerHTML = p2
    </script>
</body>

</html>